import request from '@/utils/request'

const Api = {
    // 首页接口
    index:{
        info: params => request({ method: 'get', url: '/woodHomePage/getHomePage', params }), // 首页信息
        goods: type => request({ method: 'get', url: '/woodHomePage/getGoodsAnalyze/' + type  }), // 库存分析
        sale: params => request({ method: 'get', url: '/woodHomePage/getGoodsCount', params }), // 销售排行
        getUnauditCount: params => request({ method: 'get', url: '/woodHomePage/getSalesNotAuditCount', params }), // 查询销售出库单未审核数量
        getGoodsWarningNumber : params => request({ method: 'get', url: '/woodHomePage/getGoodsWarningNumber', params }), // 请求库存预警数量
        getGoodsWarning : params => {
            let {type} = params;
            delete params.type;
            return request({ method: 'get', url: '/woodHomePage/getGoodsWarning/'+ type,params })
        }, // 请求库存预警数量
    },
    // 商品管理
    business: {    
        // 品名
        name: {
            list: params => request({ method: 'get', url: '/business/woodGoods/list', params }), // 品名管理
            detail: goodsId => request({ method: 'get', url:'/business/woodGoods/' + goodsId}),  //查询详细信息
            add: data => request({ method: 'post', url: '/business/woodGoods', data}),          //新增
            update: data => request({ method: 'put', url: '/business/woodGoods', data}),        //修改
            del: goodsId => request({ method: 'delete', url: '/business/woodGoods/' + goodsId}),//删除
        },
        // 等级
        grade: {
            list: params => request({ method: 'get', url: '/business/woodGoodsGrade/list', params }), // 等级管理  
            detail: goodsId => request({ method: 'get', url:'/business/woodGoodsGrade/' + goodsId}),  //查询详细信息
            add: data => request({ method: 'post', url: '/business/woodGoodsGrade', data}),          //新增
            update: data => request({ method: 'put', url: '/business/woodGoodsGrade', data}),        //修改
            del: goodsId => request({ method: 'delete', url: '/business/woodGoodsGrade/' + goodsId}),//删除
        },
        // 品牌
        brand: {
            list: params => request({ method: 'get', url: '/business/woodGoodsProduct/list', params }), // 品牌管理
            detail: goodsId => request({ method: 'get', url:'/business/woodGoodsProduct/' + goodsId}),  //查询详细信息
            add: data => request({ method: 'post', url: '/business/woodGoodsProduct', data}),          //新增
            update: data => request({ method: 'put', url: '/business/woodGoodsProduct', data}),        //修改
            del: goodsId => request({ method: 'delete', url: '/business/woodGoodsProduct/' + goodsId}),//删除
        },
    },
    // 仓库管理
    warehouse: {
        list: params => request({ method: 'get', url: '/warehouse/warehouseList/list', params }), //列表
        detail: warehouseId => request({ method: 'get', url: '/warehouse/warehouseList/' + warehouseId}), //查询详细信息
        add: data => request({ method: 'post', url: '/warehouse/warehouseList', data}), //增加
        update: data => request({ method: 'put', url: '/warehouse/warehouseList', data}), //修改信息
        edit: data => request({ method: 'put', url: '/warehouse/warehouseList/editState', data}),//修改状态
        del: warehouseId => request({ method: 'delete', url: '/warehouse/warehouseList/' + warehouseId})
    },
    // 采购
    woodPurchase: {
        // 入库
        in: {
            save: data => request({ method: 'post', url: '/woodPurchase/woodPurchaseIn', data }),// 新增采购入库信息
            list: params => request({ method: 'get', url: '/woodPurchase/woodPurchaseIn/list', params }),// 查询采购入库信息
            detail: inId => request({ method: 'get', url: "/woodPurchase/woodPurchaseIn/" + inId }),
            del: inId => request({ method: 'delete', url: "/woodPurchase/woodPurchaseIn/" + inId }),
            Audit: data => request({ method: 'put', url: '/woodPurchase/woodPurchaseIn/editAuditState', data }),// 新增采购入库信息
            import: '/woodPurchase/woodPurchaseIn/getFile',
            getPurchaseInCount: params => request({ method: 'get', url: '/woodPurchase/woodPurchaseIn/getPurchaseInCount', params }),// 查询采购入库信息
        },
        // 订单
        order: {
            detail: orderId => request({ method: 'get', url: "/woodPurchase/purchaseOrder/" + orderId }), //采购订单明细
            list: params => request({ method: 'get', url: "/woodPurchase/purchaseOrder/list", params }), //采购订单列表
            add: data => request({ method: 'post', url: '/woodPurchase/purchaseOrder', data}),//新增
            update: data => request({ method: 'put', url: '/woodPurchase/purchaseOrder', data}), //修改
            del: orderId => request({ method: 'delete', url: '/woodPurchase/purchaseOrder/' + orderId}),//删除
            setState: data => request({ method: 'post', url: '/woodPurchase/purchaseOrder/editBatch', data}),//批量修改采购订单入库状态
            track: params => request({ method: 'get', url: "/woodPurchase/purchaseOrderGoods/list", params }), // 采购订单跟踪
            export: params => request({ method: 'get', url: '/woodPurchase/purchaseOrderGoods/export', params }), // 导出采购订单跟踪记录表
            import: '/woodPurchase/purchaseOrder/importGoodData',

        },
        // 在途
        passage: {
            list: params => request({ method: 'get', url: "/woodPurchase/woodPurchaseInGoods/list", params }), //采购订单明细列表
        },
        // 箱柜
        bin: {
            partial: params => request({ method: 'get', url: "/woodPurchase/woodPurchaseInGoods/getBinPartialVo", params }), //箱柜分批入库
            update: data => request({ method: 'put', url: '/woodPurchase/woodPurchaseInGoods', data }),   // 更新分批入库信息 
            add: data => request({ method: 'post', url: '/woodPurchase/woodPurchaseInGoods', data }),   // 更新分批入库信息 
            detail: params => request({ method: 'get', url: "/woodPurchase/woodPurchaseInGoods/getBinPartialByIds", params }), //箱柜分批明细
            del: inId => request({ method: 'delete', url: "/woodPurchase/woodPurchaseInGoods/" + inId }), //删除箱柜分批明细
            setState: data => request({ method: 'put', url: '/woodPurchase/woodPurchaseInGoods/upBinPartialState', data }),   // 更新分批入库状态 
        },
        lading: params => request({ method: 'get', url: "/woodPurchase/woodPurchaseIn/getLadingNumShare", params }), // 提单分析
    },
    // 币别
    baseCurrency: {
        list: params => request({ method: 'get', url: '/business/woodCurrency/list', params }),
        detail: basicsId => request({ method: 'get', url:'/business/woodCurrency/' + basicsId}),  //查询详细信息
        add: data => request({ method: 'post', url: '/business/woodCurrency', data}),          //新增
        update: data => request({ method: 'put', url: '/business/woodCurrency', data}),        //修改
        del: basicsId => request({ method: 'delete', url: '/business/woodCurrency/' + basicsId}),//删除
    },
    // 港口管理
    port: {
        list: params => request({ method: 'get', url: '/business/woodPort/list', params }),
        detail: basicsId => request({ method: 'get', url:'/business/woodPort/' + basicsId}),  //查询详细信息
        add: data => request({ method: 'post', url: '/business/woodPort', data}),          //新增
        update: data => request({ method: 'put', url: '/business/woodPort', data}),        //修改
        del: basicsId => request({ method: 'delete', url: '/business/woodPort/' + basicsId}),//删除
    },
    // 付款条件
    paymentInfo: {
        list: params => request({ method: 'get', url: '/business/woodPaymentInfo/list', params }),
        detail: basicsId => request({ method: 'get', url:'/business/woodPaymentInfo/' + basicsId}),  //查询详细信息
        add: data => request({ method: 'post', url: '/business/woodPaymentInfo', data}),          //新增
        update: data => request({ method: 'put', url: '/business/woodPaymentInfo', data}),        //修改
        del: basicsId => request({ method: 'delete', url: '/business/woodPaymentInfo/' + basicsId}),//删除
    },
    // 账户
    account:{
        list: params => request({ method: 'get', url: '/business/account/list', params }),
        detail: accountId => request({ method: 'get', url:'/business/account/' + accountId}),  //查询详细信息
        add: data => request({ method: 'post', url: '/business/account', data}),          //新增
        update: data => request({ method: 'put', url: '/business/account', data}),        //修改
        del: accountId => request({ method: 'delete', url: '/business/account/' + accountId}),//删除
    },
    // 供应商
    supplier: {
        // 种类
        sort:{
            list: params => request({ method: 'get', url: '/woodSupplier/woodSupplierCategory/list', params }),
            detail: basicsId => request({ method: 'get', url: '/woodSupplier/woodSupplierCategory/' + basicsId}), // 查询供应商类别详细
            add: data => request({ method: 'post', url: '/woodSupplier/woodSupplierCategory', data}),// 新增供应商类别
            update: data => request({ method: 'put', url: '/woodSupplier/woodSupplierCategory', data}),//修改供应商类别
            del: basicsId => request({ method: 'delete', url: '/woodSupplier/woodSupplierCategory/' + basicsId}), //删除供应商类别
            export: params =>request({ method: 'get', url: '/woodSupplier/woodSupplierCategory/export', params}),//导出列表
        },
        //信息
        info:{
            list: params => request({ method: 'get', url: '/woodSupplier/woodSupplierMessage/list', params }),//供应商信息列表
            detail: supplierId => request({ method: 'get', url: '/woodSupplier/woodSupplierMessage/' + supplierId }), //供应商详细信息
            add: data => request({ method: 'post', url: '/woodSupplier/woodSupplierMessage', data }), //新增供应商信息
            edit: data => request({ method: 'put', url: '/woodSupplier/woodSupplierMessage/editSupplierState', data }), //修改供应商状态
            allot: data => request({ method: 'put', url: '/woodSupplier/woodSupplierMessage/editSupplierAllotEmployee', data}), //分配采购员
            update: data => request({ method: 'put', url: '/woodSupplier/woodSupplierMessage', data }), //修改供应商信息
            del: supplierId => request({ method: 'delete', url: '/woodSupplier/woodSupplierMessage/' + supplierId }), //删除供应商信息
            export: params => request({ method: 'get', url: '/woodSupplier/woodSupplierMessage/export', params }), //导出
        },
    },
    // 客户
    customer: {
        list: params => request({ method: 'get', url: '/customer/customer/list', params }), // 客户列表
        // 客户类别
        category: {
            list: params => request({ method: 'get', url: '/customer/customerCategory/list', params }), // 客户分类列表
            detail: params => request({ method: 'get', url: '/customer/customerCategory/' + params }),  // 客户分类列表详情
            delete: params => request({ method: 'delete', url: '/customer/customerCategory/' + params }), // 删除分类
            add: data => request({ method: 'post', url: '/customer/customerCategory', data }), // 添加分类
            edit: data => request({ method: 'put', url: '/customer/customerCategory', data }), // 修改分类
            export: params => request({ method: 'get', url: '/customer/customerCategory/export', params }), // 导出分类
        },
        // 客户拜访
        visit: {
            list: params => request({ method: 'get', url: 'customer/customerSee/list', params }), // 客户拜访列表
            detail: customerSeeId => request({ method: 'get', url: '/customer/customerSee/' + customerSeeId}), //查询详细信息
            add: data => request({ method: 'post', url: '/customer/customerSee', data}), //新增
            update: data => request({ method: 'put', url: '/customer/customerSee', data}), //修改
            del : customerSeeId => request({ method: 'delete', url: '/customer/customerSee/' + customerSeeId}), //删除
            export: params => request({ method: 'get', url: '/customer/customerSee/export', params}), //导出
        },
        // 客户信息
        info:{
            list: params => request({ method: 'get', url: '/customer/customer/list',params}), // 查询客户列表
            detail: customerCode =>request({ method: 'get', url: '/customer/customer/' + customerCode }),// 查询客户详细信息
            add: data => request({ method: 'post', url: '/customer/customer', data}), //新增
            edit: data => request({ method: 'put', url: '/customer/customer/editState', data}),//修改状态
            update: data => request({ method: 'put', url: '/customer/customer', data}), //修改
            allot: data => request({ method: 'put', url: '/customer/customer/editAllotEmployee', data}), //分配销售员
            del: customerCode => request({ method: 'delete', url: '/customer/customer/' + customerCode}), //删除
            export: params => request({ method: 'get', url: '/customer/customer/export', params}), //导出
        }
    },
    // 仓库管理
    storage: {
        // 仓库报表
        report: {
            inventory: params => request({ method: 'get', url: '/storage/gcount/list', params }),  //  商品实时库存
            inOutList: params => request({ method: 'get', url: '/storage/woodDepotDetail/list', params }), // 出入库明细
        },
        // 仓库汇总表
        gcount: {
            brand: params => request({ method: 'get', url: '/storage/gcount/getBrandNameSummarizing', params }),  //  获取品牌汇总表
            custom: params => request({ method: 'get', url: '/storage/gcount/getCustomSummarizing', params }),  //  获取自定义汇总表
            goods: params => request({ method: 'get', url: '/storage/gcount/getGoodsDetailSummarizing', params }),  //  获取商品汇总 商品明细
            warehouse: params => request({ method: 'get', url: '/storage/gcount/getGoodsWarehouseSummarizing', params }),  //  获取商品汇总 仓库信息
            format: params => request({ method: 'get', url: '/storage/gcount/getPlyWidthSummarizing', params }),  //  获取宽厚与规格汇总表
        },
        // 调拨单
        transfer: {
            list: params => request({ method: 'get', url: '/storage/woodTransferRecord/list', params }),  //  获取调拨单列表
            creatreNo: params => request({ method: 'get', url: '/storage/woodTransferRecord/getTransferIds', params }),  //  生成单据编号
            add: data => request({ method: 'post', url: '/storage/woodTransferRecord', data }), // 新增调拨单
            del: ids => request({ method: 'delete', url: "/storage/woodTransferRecord/" + ids }),
            audit: data => request({ method: 'put', url: '/storage/woodTransferRecord/editAuditState', data }),// 新增采购入库信息
            detail: id => request({ method: 'get', url: '/storage/woodTransferRecord/' + id }),
            update:data => request({ method: 'put', url: '/storage/woodTransferRecord', data }), 
        },
        // 组装拆卸
        assemble: {
            add: data => request({ method: 'post', url: '/storage/woodAssemble', data }), // 新增组装拆卸
            list: params => request({ method: 'get', url: '/storage/woodAssemble/list', params }),  //  获取列表
            del: ids => request({ method: 'delete', url: "/storage/woodAssemble/" + ids }),
            audit: data => request({ method: 'put', url: 'storage/woodAssemble/editAssembleAuditState', data }),// 新增采购入库信息
            detail: id => request({ method: 'get', url: '/storage/woodAssemble/' + id }),
            update:data => request({ method: 'put', url: '/storage/woodAssemble', data }),
        }
    },
    // 用户/销售员/采购员
    user: {
        list: params => request({ method: 'get', url: '/system/user/getList', params }),
    },
    // 管理员权限的接口
    system:{
        user:{
            list: params => request({ method: 'get', url: '/system/user/list', params }),
        }
    },
    // 销售
    sales: {
        // 出库
        delivery: {
            list: params => request({ method: 'get', url: '/business/salesDelivery/list', params }), // 查询销售出库信息列表
            deliveryId: data => request({ method: 'get', url: '/business/salesDelivery/getDeliveryId', data }), // 获取销售出库单据编号
            checkStatus: data => request({ method: 'post', url: '/business/salesDelivery/batchEditAuditStatus', data }),// 批量修改销售出库信息-审核状态
            goodDetail: params => request({ method: 'get', url: '/business/salesDeliveryGoods/list', params }), // 查询销售出库明细列表
            export: params => request({ method: 'get', url: '/business/salesDelivery/export', params }), // 导出销售出库记录表
            inDetail: deliveryId => request({ method: 'get', url: '/business/salesDelivery/' + deliveryId }),//获取销售出库商品明细详细信息
            del: deliveryIds => request({ method: 'delete', url: '/business/salesDelivery/' + deliveryIds }),//删除销售出库商品信息
            add: data => request({ method: 'post', url: '/business/salesDelivery' , data }),//增加销售出库商品信息
            exportGoods: params => request({ method: 'get', url: '/business/salesDeliveryGoods/export', params }), // 导出销售出库明细表
        },
        // 订单
        order: {
            orderId: data => request({ method: 'get', url: '/business/salesOrder/getSalesId', data }), // 获取销售订单单据编号
            detail: salesId => request({ method: 'get', url: '/business/salesOrder/' + salesId }), // 查询销售订单信息详细
            add: data => request({ method: 'post', url: '/business/salesOrder', data }),// 新增销售订单信息
            list: params => request({ method: 'get', url: '/business/salesOrder/list', params }), // 查询销售订单记录列表
            track: params => request({ method: 'get', url: '/business/salesOrderGoods/list', params }), // 查询销售订单跟踪列表
            del: salesId => request({ method: 'delete', url: "/business/salesOrder/" + salesId }),// 删除销售订单记录列表
            setState: data => request({ method: 'post', url: '/business/salesOrder/batchEditStatus', data }),   // 批量修改销售订单状态
            export: params => request({ method: 'get', url: '/business/salesOrderGoods/export', params }), // 导出销售订单明细表
        },
        // 退货
        return: {
            returnId: data => request({ method: 'get', url: '/business/salesReturn/getReturnId', data }), // 获取销售退货单据编号
            detail: returnId => request({ method: 'get', url: '/business/salesReturn/' + returnId }), // 查询销售退货信息详细
            add: data => request({ method: 'post', url: '/business/salesReturn', data }),// 新增销售退货信息
            edit: data => request({ method: 'put', url: '/business/salesReturn', data }),// 修改销售退货信息
            list: params => request({ method: 'get', url: '/business/salesReturn/list', params }), // 查询销售退货记录列表
            del: returnIds => request({ method: 'delete', url: "/business/salesReturn/" + returnIds }),// 删除销售退货记录列表
            setState: data => request({ method: 'post', url: '/business/salesReturn/batchEdit', data }),   // 批量修改销售退货状态
        },
        // 调货
        allocating: {
            detail: allocatingId => request({ method: 'get', url: 'allocating/order/' + allocatingId }), // 查询调货单信息详细
            add: data => request({ method: 'post', url: 'allocating/order', data }),// 新增调货单信息
            edit: data => request({ method: 'put', url: 'allocating/order', data }),// 修改调货单信息
            list: params => request({ method: 'get', url: 'allocating/order/list', params }), // 查询调货单记录列表
            del: allocatingIds => request({ method: 'delete', url: 'allocating/order/' + allocatingIds }),// 删除调货单记录列表
            setState: data => request({ method: 'post', url: 'allocating/order/audit', data }),   // 批量修改调货单状态 
            delInId: data => request({ method: 'post', url: 'allocating/order/deleteWoodPurchaseIn' , data }),// 删除商品采购入库和箱柜入库数据
               
        },
        // 销售汇总
        summarizing:{
            customer: params => request({ method: 'get', url: 'business/salesDelivery/getSalesCustomer', params}), //客户汇总表
            goods: params => request({ method: 'get', url: 'business/salesDeliveryGoods/getSalesCountGoods', params}), //商品汇总表
            sales: params => request({ method: 'get', url: 'business/salesDeliveryGoods/getSalesCountSalesName', params}), //销售员汇总表
            profit: params => request({ method: 'get', url: 'business/salesDelivery/getSalesProfit', params}), //利润汇总表
        }
    },
    // 公共获取唯一 ID   
    onlyId: {
        getId: data => request({ method: 'get', url: 'common/getNextId', data }),
    }
}

export default Api;
